package com.frxuexi.shop2307.adapter

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.RechargeQuota
import com.frxuexi.shop2307.R
import com.frxuexi.shop2307.databinding.ItemRechargeBinding

class RechargeAdapter:BaseQuickAdapter<RechargeQuota,BaseViewHolder>(R.layout.item_recharge) {
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemRechargeBinding>(viewHolder.itemView)
    }
    override fun convert(helper: BaseViewHolder, item: RechargeQuota) {
        val binding = DataBindingUtil.getBinding<ItemRechargeBinding>(helper.itemView)!!
        binding.bean=item

        if(item.isCheck){
            binding.reCon.setBackgroundResource(com.frxuexi.lib_base.R.drawable.shape_solid_green)
        }else{
            binding.reCon.setBackgroundResource(com.frxuexi.lib_base.R.drawable.shape_solid_lightgray)
        }
    }
}